package com.funny.stock.trade.service;

import com.funny.stock.base.service.BaseCrudService;
import com.funny.stock.trade.dao.pojo.DayTradeProfitDO;
import com.funny.stock.trade.dao.repo.DayTradeProfitRepo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description  
 * @Author  pengl
 * @Date 2020-11-22
 */

@Service
public class DayTradeProfitService extends BaseCrudService<DayTradeProfitDO,Long> {

	@Autowired
	DayTradeProfitRepo repository;

	protected JpaRepository<DayTradeProfitDO, Long> setupJpaRepository() {
		return repository;
	}

	public List<DayTradeProfitDO> findByParams(Long composeId, Long planId, String planType, String stockCode, Long createId){
		return repository.findByComposeIdAndPlanIdAndPlanTypeAndStockCodeAndCreateId(composeId,planId,planType,stockCode,createId);
	}

	public List<DayTradeProfitDO> findTradeProfitList(Long composeId,String planType, Long createId){
		return repository.findByComposeIdAndPlanTypeAndCreateId(composeId, planType,createId);
	}

//	public List<DayTradeProfitDO> findT0TradeProfitList(Long composeId, Long createId){
//		return repository.findByComposeIdAndPlanTypeAndCreateId(composeId, StockConstants.STOCK_STRATEGY_T0,createId);
//	}


}
